package com.sven;


import org.apache.dubbo.config.annotation.Reference;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
public class DemoApplication {

    //使用dubbo提供的@Reference注解获得衣蛾远程代理对象
    @Reference(url = "dubbo://192.168.27.1:20880/com.sven.IHelloService")
    private IHelloService helloService;

    public static void main(String[] args) {
        SpringApplication.run(DemoApplication.class, args);
    }

    @Bean
    public ApplicationRunner runner(){
        return args -> System.out.println(helloService.sayHello("沙县"));
    }


}
